<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <title>Thymeleaf tutorial: exercise 7</title>
        <link rel="stylesheet" href="../../../css/main-static.css" th:href="@{/css/main.css}" />
        <meta charset="utf-8" />
    </head>
    <body>
        <h1>Thymeleaf tutorial - Solution for exercise 7: iteration stats</h1>
        <h2>Product list</h2>
        <table>
            <thead>
                <tr>
                    <th>Index</th>
                    <th>Description</th>
                    <th>Price</th>
                    <th>Available from</th>
                </tr>
            </thead>
            <tbody th:remove="all-but-first">
                <tr th:each="product : ${productList}">
                    <td th:text="${productStat.count}">1</td>
                    <td th:text="${product.description}">Red chair</td>
                    <td th:text="${'$' + #numbers.formatDecimal(product.price, 1, 2)}">$350</td>
                    <td th:text="${#dates.format(product.availableFrom, 'dd-MMM-yyyy')}">28-Jun-2013</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>White table</td>
                    <td>$200</td>
                    <td>15-Jul-2013</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>Reb table</td>
                    <td>$200</td>
                    <td>15-Jul-2013</td>
                </tr>
                <tr>
                    <td>4</td>
                    <td>Blue table</td>
                    <td>$200</td>
                    <td>15-Jul-2013</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>
